﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Transact2.aspx.cs" Inherits="Honestysoft.Workflow.Client.WebUI.Workflow.WFProcess.Transact2" %>

<%@ Register Src="../Control/WFTitle.ascx" TagName="WFTitle" TagPrefix="uc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns:v="urn:schemas-microsoft-com:vml" >
<head id="Head1" runat="server">
    <title>填写、查看处理意见。</title>
    <base target="_self" />
   <meta http-equiv="Pragma" content="no-cache" />
   <meta http-equiv="Cache-Control" content="no-cache"/>
   <meta http-equiv="Expires" content="0"/>  
   <script language="javascript" type="text/javascript" src="js/Win.js"></script>
   <script language="javascript" type="text/javascript" src="../js/WFScript.js"></script>   
   <link href="../css/showDiv/opendiv.css" rel="stylesheet" type="text/css" />
   <script language="javascript" type="text/javascript" src="../css/showDiv/opendiv.js"></script>
   <script language="javascript" type="text/javascript" src="../cal/calendar.js"></script>
   <script language="javascript" type="text/javascript" src="../js/WFWinCtrlScript.js"></script>
    <style type="text/css">
        body
        {
            font-size:12px;
        }
        </style>
        <link href="../Styles/control.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div align="center" style="vertical-align:top;">
        <table width="96%" cellpadding="0" cellspacing="0">
            <tr height="40px">
                <td style="width: 100%">
                    <uc2:WFTitle ID="WFTitle1" runat="server"  Title="填写、查看处理意见。" />
                </td>
            </tr>
            <tr height="400px" valign="top" align="left">
                <td style="width: 100%">
                    <div style="overflow-x:hidden;overflow-y:auto;height:390px">  
                        <table width="100%"  cellpadding="0" cellspacing="0">
                        <tr>                           
                            <td>
                            </td>
                            <td>
                                <table width="100%"  cellpadding="0" cellspacing="0">                                   
                                    <tr>
                                        <td><font color="blue">处理环节：</font></td>
                                        <td><asp:Label ID="lblActTempName" runat="server"></asp:Label></td>
                                        <td>
                                            <asp:Label ID="lblResult" runat="server" Text="处理结果：" ForeColor="blue"></asp:Label></td>
                                        <td><asp:DropDownList ID="ddlResult" runat="server" CssClass="input2"></asp:DropDownList><input type="hidden" id="hiDispResult" runat="server" value="1" /> </td>
                                    </tr>
                                    <tr>
                                        <td><font color="blue">处 理 人：</font></td>
                                        <td><asp:TextBox ID="txtTransactName" runat="server" Enabled="False"  CssClass="input2"></asp:TextBox></td>
                                        <td><font color="blue">处理时间：</font></td>
                                        <td>
                                            <asp:TextBox ID="txtTranTime" runat="server" onfocus="setday(this)"  CssClass="input2"></asp:TextBox></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>                             
                            <td width="20px">
                            </td>
                            <td>
                             <font color="blue">处理意见：</font></td>
                        </tr>
                        <tr> 
                            <td>
                            </td>
                            <td><asp:TextBox ID="txtOpinion"  runat="server" TextMode="MultiLine" MaxLength="2000" Wrap="true" BackColor="white" Width="96%" Rows="14" Font-Names="宋体" Font-Size="12pt"></asp:TextBox></td><td></td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            
                            <td><asp:CheckBox ID="chkSaveOpinion" Text="保存为意见模板" runat="server" Checked="false" />&nbsp;&nbsp;
                                <asp:LinkButton ID="lbtnImportOpinion" runat="server">导入意见模板</asp:LinkButton></td>
                        </tr>        
                    </table>
                    </div>
                </td>
            </tr>
            <tr height="25px">
                <td style="width: 100%" align="right">
                    <table width="100%">
                        <tr>
                            <td align="left">
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Button ID="btnViewOpinion" runat="server" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'"  Text="查看意见" /></td>
                            <td>
                                <asp:Button ID="btnBefore" runat="server"  Text="上一步" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'"  Visible="false" />
                                <asp:Button ID="btnNext" runat="server"  Text="下一步" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'"  OnClientClick="return CheckCanDoNext();" OnClick="btnNext_Click"  />
                               <asp:Button ID="btnCancel" runat="server" Text="取  消"  class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'"  OnClientClick="window.close();"/>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                         </tr>
                     </table>                    
                </td>
            </tr>
        </table>
        <input type="hidden" id="HidEspecialSendNodeID" runat="server" />
        <input type="hidden" id="HidIsAllowNullOpinion" runat="server" />
    </div>
    </form>
    <!-- #INCLUDE FILE="../css/showDiv/Part.txt" -->
    <script language="javascript" type="text/javascript">
        document.getElementById("<%=txtOpinion.ClientID %>").focus();
        function mViewOpinion(Home) {
            window.showModalDialog(Home + "WorkFlow/WFProcess/ViewOpinionPaint.aspx", window, 'dialogHeight=500px;dialogWidth=560px;help=no;scrollbars=no;status=no');
            return false;
        }
        //导入意见模板
        function ImoprtOpinionTemplate(Home, EmployeeID) {
            var width = "500";
            var height = "300";
            var opinion = window.showModalDialog(Home + 'WorkFlow/WFProcess/WFOpinionTemplate.aspx?EmployeeID=' + EmployeeID, window, "scroll:0;status:0;help:1;resizable:1;dialogWidth:" + width + "px;dialogHeight:" + height + "px");
            if (opinion != "") {
                document.getElementById("<%=txtOpinion.ClientID %>").value += opinion;
            }
            return false;
        }
        function CheckCanDoNext() {
            if (!mIsAgree()) {
                return false;
            }
            var chk = document.getElementById("<%=chkSaveOpinion.ClientID %>");
            var opinion = document.getElementById("<%=txtOpinion.ClientID %>").value;
            var allowNullOp = document.getElementById("<%=HidIsAllowNullOpinion.ClientID %>").value;
            if (chk.checked) {
                if (trim(opinion) == "") {
                    alert("不能保存空意见为意见模板！");
                    return false;
                }
            }
            if (allowNullOp == "<%= ((int)Honestysoft.Workflow.Model.WFEnumData.Flag.No).ToString() %>") {
                if (trim(opinion) == "") {
                    alert("本环节设置不允许空意见，请输入意见！");
                    return false;
                }
            }
            WF_divshow(0, '', 200, 40);
            return true;
        }
        function mIsAgree() {
            if (document.getElementById("<%=hiDispResult.ClientID %>").value == "0") { return true; }
            var sel = document.getElementById("<%=ddlResult.ClientID %>");
            if (sel.options[sel.options.selectedIndex].value == "<%=((int)Honestysoft.Workflow.Model.WFEnumData.TransactionResult.UserSelect).ToString() %>") {
                alert("请选择处理结果！");
                return false;
            }
            if (sel.options[sel.options.selectedIndex].value == "<%=((int)Honestysoft.Workflow.Model.WFEnumData.TransactionResult.disAgree).ToString() %>") {
                if (confirm("您选择了处理结果为不同意，您仍可继续发送给下一环节。点击确定则发送给下一环节。")) {
                    return true;
                }
                return false;
            }
            return true;
        }
        function mEspecialSend() {
            var SelectNodeID = window.showModalDialog('<%= WorkflowApply.Home %>WorkFlow/WFProcess/EspecialSendSelect.aspx', window, "scroll:0;status:0;help:1;resizable:1;dialogWidth:560px;dialogHeight:500px");
            if (SelectNodeID == "") { return false; }
            document.getElementById("<%=HidEspecialSendNodeID.ClientID %>").value = SelectNodeID;
            return true;
        }
        function trim(str) {
            return str.replace(/(^\s*)|(\s*$)/g, "");
        }
    </script>
    <script language="javascript" type="text/javascript">
        if (window.returnValue == null) {
            window.returnValue = GetCancelParam();
        }
    </script>
</body>
</html>
